

$(function(){
	$('#usersdiv').on('click','.user .goedit',function(){
		if(confirm('确认要修改吗?')){
			var uid = $(this).siblings('.c0').text();
			var uname = $.trim($(this).siblings('.c1').text());
			var upwd = $.trim($(this).siblings('.c2').text());
			if(upwd.length > 0){
				if(confirm('确认要修改用户的密码吗?')){
					
				}else{
					$(this).siblings('.c2').text('');
				}
			}
			var email = $(this).siblings('.c3').text();
			var sex = $(this).siblings('.c4').text();
			var photo = $(this).siblings('.c5').text();
			var power = $(this).siblings('.c6').text();
			var bz = $(this).siblings('.c7').text();
			$.post("ajax/islogin.php",{
				eve: 7//7为修改前台用户资料
				,uid: uid
				,uname: uname
				,upwd: upwd
				,email: email
				,sex: sex
				,photo: photo
				,power: power
				,bz: bz
			},function(data, textStatus, reXML){
				alert(data);
			},"text");
		}
	});
	
	$('#usersdiv').on('click','.user .godel',function(){
		if(confirm('确认要删除吗?')){
			var uid = $(this).siblings('.c0').text();
			var parent = $(this).parent();
			$.post("ajax/islogin.php",{
				eve: 8//8为删除前台用户资料
				,uid: uid
			},function(data, textStatus, reXML){
				//alert(data);
				if(data == 1){
					//parent.remove();
					//$("#usersdiv").load(location.href+" #usersdiv>*",""); //局部刷新
					alert('删除成功!');
				}else{
					alert('删除失败!');
				}
				
			},"text");
		}
	});
});

